home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / qwktxt45.zip / QWK.TXT < prev    next >
Text File  |  1992-07-22  |  39KB  |  852 lines

  1.                          QWK Mail Packet File Layout
  2.                               by Patrick Y. Lee
  3.  
  4. Version 1.0 - February 23, 1992
  5.      First release.
  6. Version 1.1 - March 15, 1992
  7.      Minor fixes here and there to make everything just right.
  8. Version 1.2 - May 31, 1992
  9.      Added a few items to the DOOR.ID file that is being supported by Qmail
  10.      DeLuxe² version 1.25.
  11. Version 1.3 - July 6, 1992
  12.      Added changes to the QWK format adopted by Qmail door.  Specifically
  13.      line 10 of CONTROL.DAT file and bytes 126-127 of MESSAGES.DAT file. 
  14.      Please refer to the appropriate section for the changes.
  15.  
  16. This document is Copyright 1992 by Patrick Y. Lee.
  17.  
  18. The QWK-format is Copyright 1987 by Sparkware.
  19.  
  20. All program names mentioned in this document are either Copyright or Trade-
  21. mark of respective owner(s).
  22.  
  23. The author provides this file as-is without warranty of any kind, either
  24. expressed or implied.  You are using the information in this file at your
  25. own discretion.  The author assumes no responsibilities for damages, either
  26. physically or financially, from the use of this information.
  27.  
  28. This document may be freely distributed by any means (electronically, pa-
  29. per, etc.), provided that it is distributed in its entirety.  Portions of
  30. this document may be reproduced without credit.
  31.  
  32.                               Table of Contents
  33.  
  34. 1.  Introduction
  35.     1.1.  Intent
  36.     1.2.  History
  37.     1.3.  Questions, corrections, etc.
  38. 2.  Conventions & overview
  39.     2.1.  The BBS ID
  40.     2.2.  Packet compression
  41.     2.3.  Packet transfer & protocols
  42.     2.4.  Limitations
  43. 3.  QWK files
  44.     3.1.  Naming convention
  45.     3.2.  Control file (CONTROL.DAT)
  46.     3.3.  Welcome file
  47.     3.4.  Goodbye file
  48.     3.5.  News file
  49.     3.6.  Qmail DeLuxe² menu file
  50.     3.7.  New uploads listing (NEWFILES.DAT)
  51.     3.8.  Bulletin file(s) (BLT-x.y)
  52.     3.9.  Message file (MESSAGES.DAT)
  53.     3.10.  Index files (*.NDX)
  54.         3.10.1.  Conference indices
  55.         3.10.2.  Personal index (PERSONAL.NDX)
  56.     3.11.  Pointer file
  57.     3.12.  SESSION.TXT
  58. 4.  REP files
  59.     4.1.  Naming convention
  60.     4.2.  Message file (BBSID.MSG)
  61.     4.3.  Door control messages
  62.     4.3.1.  DOOR.ID file
  63.     4.3.2.  Qmail
  64.     4.3.3.  MarkMail
  65.     4.3.4.  KMail
  66.     4.3.5.  RoseMail
  67.     4.3.6.  Complete Mail Door
  68.     4.4.  Turning off the echo flag
  69.     4.5.  Tag-lines
  70. 5.  Net mail
  71. A.  Credits & contributions
  72. B.  Sample Turbo Pascal and C code
  73. C.  Sample message
  74. D.  Sample index file
  75.  
  76.                         -=-=-=-=-=-=-<>-=-=-=-=-=-=-
  77.  
  78. To search for a specific section, look for "[x.x]" using your editor or
  79. viewer.  For example, to jump to the tag-lines portion of this file, search
  80. for "[4.5]" with your editor or text viewer.
  81.  
  82.                         -=-=-=-=-=-=-<>-=-=-=-=-=-=-
  83.  
  84. [1]  Introduction
  85.  
  86. [1.1]  Intent
  87.  
  88. This document is written to facilitate programmers who want to write
  89. QWK-format mail doors or readers.  It is intended to be a comprehen-
  90. sive reference covering all areas of QWK-format mail processing. 
  91. Detailed break down of each file is included, as are implementation
  92. information.  In addition, door and reader specific information may be
  93. included, when such information are available to me.
  94.  
  95. [1.2]  History
  96.  
  97. The QWK-format was invented by Mark "Sparky" Herring in 1987.  It was
  98. based on Clark Development Corporation's PCBoard version 12.0 message
  99. base format.  Off-line mail reading has become popular only in recent
  100. years.  Prior to summer of 1990, there were only two QWK-format off-
  101. line mail reader programs.  They were Qmail DeLuxe by Mark Herring and
  102. EZ-Reader by Eric Cockrell.  Similarly for the doors, there were only
  103. two -- Qmail by Mark Herring and MarkMail by Mark Turner.  They were
  104. both for PCBoard systems.
  105.  
  106. A lot has changed in both off-line reader and mail door markets since
  107. summer 1990.  Now, there are more than a dozen off-line mail readers
  108. for the PC.  Readers for the Macintosh, Amiga, and Atari exist as
  109. well.  There are over a half dozen doors for PCBoard, and QWK-format
  110. doors exist for virtually all of the popular BBS softwares.  All of
  111. these happened in less than two years!  More readers and doors are in
  112. development as I write this, keep up the excellent work.  In addition
  113. to doors, some BBS softwares has QWK-format mail facility built in.
  114.  
  115. Off-line mail reading is an integral part of BBS calling.  Conference
  116. traffic and selection on all networks have grown dramatically in re-
  117. cent years that on-line reading is a thing of the past.  Off-line mail
  118. reading offers an alternative to reading mail on-line -- It offers
  119. speed that cannot be achieved with on-line mail reading.
  120.  
  121. The reason why QWK-format readers and doors seem to have gained popu-
  122. larity is probably dued to its openness.  The format is readily avail-
  123. able to any programmer who wishes to write a program that utilize it. 
  124. Proprietary is a thing of the past, it does not work!  Openness is
  125. here to stay and QWK-format is a part of it.
  126.  
  127. [1.3]  Questions, corrections, etc.
  128.  
  129. Most of the message networks today have a conference/echo devoted to
  130. discussion of off-line readers and mail doors.  The ones I know are on
  131. FidoNet, ILink, Intelec, and RIME.  If you have questions after read-
  132. ing anything in here, feel free to drop by any of the above conference
  133. /echo and I am sure other QWK authors will try to help.
  134.  
  135. I can be reached in the Off-line conferences on RIME, ILink, and In-
  136. telec, as well as the Common conference on RIME.  Mail can be routed
  137. to node RUNNINGB.  I can be reached on the Internet at
  138. "p.lee@green.cooper.edu".  Any corrections, extensions, comments, and
  139. criticisms are welcomed.
  140.  
  141. [2]  Conventions & overview
  142.  
  143. All offsets referenced in this document will be relative to 1.  I am
  144. not a computer, I start counting at one, not zero!
  145.  
  146. Words which are enclosed in quotes should be entered as-is.  The quota-
  147. tions are not part of the string unless noted.
  148.  
  149. You may have noticed I use the phrase "mail program" or "mail facili-
  150. ty" instead of mail doors.  This is because some BBS softwares offer
  151. the option of creating QWK-format mail packets right from the BBS. 
  152. With those, there is no need for an external mail door.
  153.  
  154. [2.1]  The BBS ID
  155.  
  156. The BBS ID (denoted as BBSID) is a 1-8 characters word that identifies
  157. a particular BBS.  This identifier should be obtained from line 5 of
  158. the CONTROL.DAT file (see section 3.2.1).
  159.  
  160. [2.2]  Packet compression
  161.  
  162. Most mail packets are compressed when created by the mail door in
  163. order to save download time and disk space.  However, many off-line
  164. reader programs allow the user to unarchive a mail packet outside of
  165. the reader program, so the reader will not have to unarchive it.  Upon
  166. exit, the reader will not call the archiver to save it.  It is up to
  167. the user to archive the replies.  This is useful if the user has limit-
  168. ed memory and cannot shell out to DOS to run the unarchive program. 
  169. For readers based on non-PC equipment, the user may be using less
  170. common compression program that does not have command line equivalent.
  171.  
  172. [2.3]  Packet transfer & protocols
  173.  
  174. There is no set rule on what transfer protocol should be used.  Howev-
  175. er, it would be nice for the mail program on the BBS to provide the
  176. Sysop with options as to what to offer.  This should be a configura-
  177. tion option for the user.
  178.  
  179. [2.4]  Specifications & limitations
  180.  
  181. There aren't many known limits in the QWK specification.  However,
  182. various networks seem to impose artificial limits.  On many of the PC-
  183. based networks, 99-lines appears to be the upper limit for some soft-
  184. wares.  However, most of the readers can handle more than that.  Read-
  185. er authors reading this may want to offer the option to split replies
  186. into n lines each (the actual length should be user definable so when
  187. the network software permits, the user can increase this number).
  188.  
  189. [3]  QWK files
  190.  
  191. [3.1]  Naming convention
  192.  
  193. Generally, the name of the mail packet is BBSID.QWK.  However, this
  194. does not have to be the case.  When the user downloads more than one
  195. mail packet at one time, either the mail program or the transfer proto-
  196. col program will rename the second and subsequent mail packets to
  197. other names.  They will either change the file extension or add a
  198. number to the end of the filename.  In either case, you should not
  199. rely on the name of the QWK file as the BBSID.  The BBSID, as men-
  200. tioned before, should be obtained from line 5 of the CONTROL.DAT file. 
  201. In addition, mail packets do not have to end with QWK extension ei-
  202. ther.  The user may choose to name them with other file extensions.
  203.  
  204. [3.2]  Control file (CONTROL.DAT)
  205.  
  206. The CONTROL.DAT file is a simple ASCII file.  Each line is terminated
  207. with a carriage return and line feed combination.  All lines should
  208. start on the first column.
  209.  
  210. Line #
  211.  1   My BBS                   BBS name
  212.  2   New York, NY             BBS city and state
  213.  3   212-555-1212             BBS phone number
  214.  4   John Doe, Sysop          BBS Sysop name
  215.  5   20052,MYBBS              Mail door registration #, BBSID
  216.  6   01-01-1991,23:59:59      Mail packet creation time
  217.  7   JANE DOE                 User name (upper case)
  218.  8                            Name of menu for Qmail, blank if none
  219.  9   0                        ? Seem to be always zero
  220. 10   999                      Total number of messages in packet
  221. 11   121                      Total number of conference minus 1
  222. 12   0                        1st conf. number
  223. 13   Main Board               1st conf. name (13 characters or less)
  224. 14   1                        2nd conf. number
  225. 15   General                  2nd conf. name
  226. ..   3                        etc. onward until it hits max. conf.
  227. ..   123                      Last conf. number
  228. ..   Amiga_I                  Last conf. name
  229. ..   HELLO                    Welcome screen file
  230. ..   NEWS                     BBS news file
  231. ..   SCRIPT0                  Log off screen
  232.  
  233. Some mail doors, such as MarkMail, will send additional information
  234. about the user from here on.
  235.  
  236. 0                             ?
  237. 25                            Screen length on the BBS
  238. JANE DOE                      User name in uppercase
  239. Jane                          User first name in mixed case
  240. NEW YORK, NY                  User city information
  241. 718 555-1212                  User data phone number
  242. 718 555-1212                  User home phone number
  243. 108                           Security level
  244. 00-00-00                      Expiration date
  245. 01-01-91                      Last log on date
  246. 23:59                         Last log on time
  247. 999                           Log on count
  248. 0                             Current conference number on the BBS
  249. 0                             Total KB downloaded
  250. 999                           Download count
  251. 0                             Total KB uploaded
  252. 999                           Upload count
  253. 999                           Minutes per day
  254. 999                           Minutes remaining today
  255. 999                           Minutes used this call
  256. 32767                         Max. download KB per day
  257. 32767                         Remaining KB today
  258. 0                             KB downloaded today
  259. 23:59                         Current time on BBS
  260. 01-01-91                      Current date on BBS
  261. My BBS                        BBS network tag-line
  262. 0                             ?
  263.  
  264. Some mail doors will offer the option of sending an abbreviated con-
  265. ference list.  That means the list will contain only conferences the
  266. user has selected.  This is done because some mail readers cannot
  267. handle more than n conferences at this time.  Users using those read-
  268. ers will need this option if the BBS they call have too many confer-
  269. ences.
  270.  
  271. [3.3]  Welcome file
  272.  
  273. This file usually contains the log on screen from the BBS.  The exact
  274. filename is specified in the CONTROL.DAT file, after the conference
  275. list.  This file may be in any format the Sysop chooses it be -- usu-
  276. ally either in plain ASCII or with ANSI screen control code.  Some
  277. Sysops (notably PCBoard Sysops) may use BBS-specific color change code
  278. in this file as well.  Current mail programs seem to handle the trans-
  279. lations between BBS-specific code to ANSI based screen control codes.
  280.  
  281. Even if the CONTROL.DAT file contains the filename of this file, it
  282. may not actually exist in the mail packet.  Sometimes, users will
  283. manually delete this file before entering the mail reader.  Some off-
  284. line readers offer the option to not display this welcome screen; some
  285. will display this file regardless.  Some doors, similarly, will offer
  286. option to the user to not send this file.
  287.  
  288. [3.4]  Goodbye file
  289.  
  290. Similar to the welcome file above, the filename to the goodbye file is
  291. in the CONTROL.DAT file.  This is the file the BBS displays when the
  292. user logs off the board.  It is optional, as always, to send this file
  293. or to display it.
  294.  
  295. [3.5]  News file
  296.  
  297. Many mail doors offer the option to send the news file from the BBS. 
  298. Most will only send this when it has been updated.  Like the welcome
  299. and goodbye files, the filename to the news file is found in the CON-
  300. TROL.DAT file.  It can be in any format the Sysop chooses, but usually
  301. in either ASCII or ANSI.  Like the welcome screen, current mail facil-
  302. ities seem to handle translation between BBS-specific control codes to
  303. ANSI screen control codes.
  304.  
  305. [3.6]  Qmail DeLuxe² menu file
  306.  
  307. This file is of use only for Qmail DeLuxe² mail reader by Sparkware. 
  308. The filename is found on line 8 of the CONTROL.DAT file.
  309.  
  310. [3.7]  New uploads listing (NEWFILES.DAT)
  311.  
  312. Most mail programs on the BBS will offer the option to scan new files
  313. uploaded to the BBS.  The result is found in a file named
  314. NEWFILES.DAT.  The mail program, if implementing this, should update
  315. the last file scan field in the user's profile, if there is such a
  316. field, as well as other information required by the BBS.  The mail
  317. program should, of course, scan new files only in those areas the user
  318. is allowed access.
  319.  
  320. [3.8]  Bulletin files (BLT-x.y)
  321.  
  322. Most mail programs will also offer the option to include updated bulle-
  323. tin files found on the BBS in the mail packet.  The bulletins are
  324. named BLT-x.y, where x is the conference/echo the bulletin came from,
  325. and y the bulletin's actual number.  The mail program will have to
  326. take care of updating the last read date on the bulletins in the user
  327. record.
  328.  
  329. [3.9]  Message file (MESSAGES.DAT)
  330.  
  331. The MESSAGES.DAT file is the most important.  This is where all of the
  332. messages are contained in.  The QWK file format is based on PCBoard
  333. 12.0 message base format from Clark Development Corporation (maker of
  334. PCBoard BBS software).
  335.  
  336. The file has a logical record length of 128-bytes.  The first record
  337. of MESSAGES.DAT always contain a copyright notice saying "Produced by
  338. Qmail...Copyright (c) 1987 by Sparkware.  All Rights Reserved".  The
  339. rest of the record is space filled.  Actual messages consist of a 128-
  340. bytes header, plus one or more 128-bytes block with the message text. 
  341. Actual messages start in record 2.  The header block is layed out as
  342. follows:
  343.  
  344. Offset  Length  Description
  345. ------  ------  ----------------------------------------------------   
  346.     1       1   Message status flag (unsigned character)
  347.                 ' ' = public, unread
  348.                 '-' = public, read
  349.                 '+' = private, unread
  350.                 '*' = private, read
  351.                 '~' = comment to Sysop, unread
  352.                 '`' = comment to Sysop, read
  353.                 '%' = password protected, unread
  354.                 '^' = password protected, read
  355.                 '!' = group password, unread
  356.                 '#' = group password, read
  357.                 '$' = group password to all
  358.     2       7   Message number (in ASCII)
  359.     9       8   Date (mm-dd-yy, in ASCII)
  360.    17       5   Time (24 hour hh:mm, in ASCII)
  361.    22      25   To (uppercase, left justified)
  362.    47      25   From (uppercase, left justified)
  363.    72      25   Subject of message (mixed case)
  364.    97      12   Password (space filled)
  365.   109       8   Reference message number (in ASCII)
  366.   117       6   Number of 128-bytes blocks in message (including the
  367.                 header, in ASCII; the lowest value should be 2, header
  368.                 plus one block message; this number may not be left
  369.                 flushed within the field)
  370.   123       1   Flag (ASCII 225 means message is active; ASCII 226
  371.                 means this message is to be killed)
  372.   124       2   Conference number (unsigned word)
  373.   126       2   Logical message number in the current packet; i.e.
  374.                 this number will be 1 for the first message, 2 for the
  375.                 second, and so on. (unsigned word)
  376.   128       1   Indicates whether the message has a network tag-line
  377.                 or not.  A value of '*' indicates that a network tag-
  378.                 line is present; a value of ' ' (space) indicates
  379.                 there isn't one.  Messages sent to readers (non-net-
  380.                 status) generally leave this as a space.  Only network
  381.                 softwares need this information.
  382.  
  383. Fields such as To, From, Subject, Message #, Reference #, and the like
  384. are space padded if they are shorter than the field's length.
  385.  
  386. The message text starts in the next record.  You can find out how many
  387. blocks make up one message by looking at the value of "Number of 128
  388. byte blocks".  Instead of carriage return and line feed combination,
  389. each line in the message end with an ASCII 227 (pi character) symbol. 
  390. There are reports that some (buggy) readers have problems with messag-
  391. es which do not end the last line in the message with an ASCII 227. 
  392. If a message does not completely occupy the 128-bytes block, the re-
  393. mainder of the block is padded with space or null.
  394.  
  395. Note that there seems to exist old doors which will use one byte to
  396. represent the conference number and pad the other one with an ASCII 32
  397. character.  The program reading this information will have to deter-
  398. mine whether the ASCII 32 in byte 125 of the header is a filler or
  399. part of the unsigned word.  One method is to look in the CONTROL.DAT
  400. file to determine the highest conference number.
  401.  
  402. Even though most mail programs will generate MESSAGES.DAT files that
  403. appear in conference order, this is not always the case.  Tomcat!
  404. (mail door for Wildcat! BBS) generates MESSAGES.DAT that is not in
  405. conference order.  This is due to how Wildcat! itself stores mail on
  406. the BBS.
  407.  
  408. Note that some mail doors offer the option of sending a mail packet
  409. even though there may be no messages to send -- thus an empty
  410. MESSAGES.DAT file.  This was tested with Qmail 4.0 door and it sent a
  411. MESSAGES.DAT file that contains a few empty 128-bytes blocks.  Other
  412. mail doors seem to be able to produce QWK files without the MESSAG-
  413. ES.DAT file at all!  Apparently, there was no standard established in
  414. this procedure.
  415.  
  416. [3.10]  Index files (*.NDX)
  417.  
  418. [3.10.1]  Conference indices
  419.  
  420. The index files contain a list of pointers pointing to the beginning
  421. of messages in the MESSAGES.DAT file.  The pointer is in terms of the
  422. 128-bytes block logical record that the MESSAGES.DAT file is in.  Each
  423. conference has its own xxx.NDX file, where xxx is the conference num-
  424. ber left padded with zeroes.  Some mail programs offer the user the
  425. option to not generate index files.  So the mail readers need to cre-
  426. ate the index files if they are missing.
  427.  
  428. EZ-Reader 1.xx versions will convert the NDX files from Microsoft MKS
  429. format into IEEE long integer format.  The bad part about this is that
  430. the user may store those index files back into the QWK file.  When
  431. another reader reads the index files, it will be very confused!
  432.  
  433. Special note for BBSes with more than 999 conferences: Index files for
  434. conferences with four digit conference numbers is named xxxx.NDX,
  435. where xxxx is the conference number (left padded with zeroes).  The
  436. filenames for three digit conferences are still named xxx.NDX on these
  437. boards.  I would assume filenames for conferences in the five digit
  438. range is xxxxx.NDX, but I have not seen a BBS with 10,000 or more
  439. conferences yet!
  440.  
  441. Each NDX file uses a five bytes logical record length and is formatted
  442. to:
  443.  
  444. Offset  Length  Description
  445. ------  ------  ------------------------------------------------------
  446.     1       4   Record number pointing to corresponding message in
  447.                 MESSAGES.DAT.  This number is in the Microsoft MKS$
  448.                 BASIC format.
  449.     5       1   Conference number of the message.  This byte should
  450.                 not be used because it duplicates both the filename of
  451.                 the index file and the conference # in the header.  It
  452.                 is also one byte long, which is insufficient to handle
  453.                 conferences over 255.
  454.  
  455. Please refer to appendix B for routines to deal with MKS numbers.
  456.  
  457. [3.10.2]  Personal index (PERSONAL.NDX)
  458.  
  459. There is a special index file named PERSONAL.NDX.  This file contains
  460. pointers to messages which are addressed to the user, i.e. personal
  461. messages.  Some mail door and utility programs also allow the selec-
  462. tion of other messages to be flagged as personal messages.
  463.  
  464. [3.11]  Pointer file
  465.  
  466. Pointer file is generally included so that the user can reset the last
  467. read pointers on the mail program, in case there is a crash on the BBS
  468. or some other mishaps.  There should be little reason for the reader
  469. program to access the pointer file.
  470.  
  471. The pointer files I have seen are:
  472.  
  473. Qmail          BBSID.PTR
  474. MarkMail       BBSID.PNT
  475. KMail          BBSID.PNT
  476. SFMailQwk      BBSID.SFP
  477.  
  478. Additions to this list are welcomed.
  479.  
  480. [3.12]  SESSION.TXT
  481.  
  482. This file, if included, will contain the message scanning screen the
  483. user sees from the door.
  484.  
  485. [4]  REP files
  486.  
  487. [4.1]  Naming convention
  488.  
  489. The reply file is named BBSID.MSG, where BBSID is the ID code for the
  490. BBS found on line 5 of the CONTROL.DAT file.  Once this file has been
  491. created, the mail reader can archive it up into a file with REP exten-
  492. sion.
  493.  
  494. [4.2]  Message file (BBSID.MSG)
  495.  
  496. Replies use the same format as the MESSAGES.DAT file, except that
  497. message number field will contain the conference number instead.  In
  498. other words, the conference number will be placed in the two bytes
  499. (binary) starting at offset 124, as well as the message number field
  500. (ASCII) at offset 2.
  501.  
  502. The first 128-bytes record of the file is the header.  Instead of the
  503. copyright notice, it contains the BBSID of the BBS.  This 1-8 charac-
  504. ter BBSID must start at the very first byte and must match what the
  505. BBS has.  The rest of the record is space padded.  The replies start
  506. at record 2.  Each reply message will have a 128-bytes header, plus
  507. one or more for the message text; followed by another header, and so
  508. on.
  509.  
  510. The mail program must check to make sure the BBSID in the first block
  511. of the BBSID.MSG file matches what the BBS has!
  512.  
  513. [4.3]  Door control messages
  514.  
  515. These messages allow the user to change their setup on the BBS by
  516. simply entering a message.  The goal is to allow the user to be able
  517. to control most areas of the BBS via the mail door.  Different mail
  518. doors have different capabilities.  Most all of them offer the ability
  519. to add and drop a conference, as well as reset the last read pointers
  520. in a conference.
  521.  
  522. [4.3.1]  DOOR.ID file
  523.  
  524. The DOOR.ID file was first introduced by Greg Hewgill with Tomcat!
  525. mail door and SLMR mail reader.  Since then, many other authors have
  526. picked up this idea and use the format.  This file provides the neces-
  527. sary identifiers a reader needs to send add, drop, etc. messages to
  528. the mail door.  It tells the reader who to address the message to and
  529. what can be put in the subject line.
  530.  
  531. DOOR = <doorname>             This is the name of the door that creat-
  532.                               ed the QWK packet, i.e. <doorname> =
  533.                               Tomcat.
  534. VERSION = <doorversion>       This is the version number of the door
  535.                               that created the packet, i.e.
  536.                               <doorversion> = 2.9.
  537. SYSTEM = <systemtype>         This is the underlying BBS system type
  538.                               and version, i.e. <systemtype> = Wildcat
  539.                               2.55.
  540. CONTROLNAME = <controlname>   This is the name to which the reader
  541.                               should send control messages, eg.
  542.                               <controlname> = TOMCAT.
  543. CONTROLTYPE = <controltype>   This can be one of ADD, DROP, REQUEST,
  544.                               or others.  ADD and DROP are pretty
  545.                               obvious (they work as in MarkMail), and
  546.                               REQUEST is for use with BBS systems that
  547.                               support file attachments.  Try out SLMR
  548.                               with CONTROLTYPE = REQUEST and use the Q
  549.                               function.  (This seems to be a Wildcat!
  550.                               BBS feature.)
  551. RECEIPT                       This flag indicates that the door/BBS is
  552.                               capable of return receipts when a mes-
  553.                               sage is received.  If the first three
  554.                               letters of the subject are RRR, then the
  555.                               door should strip the RRR and set the
  556.                               'return-receipt-requested' flag on the
  557.                               corresponding message.
  558. MIXEDCASE = YES               If this line is found then the reader
  559.                               will let you use upper and lower case
  560.                               names and subjects.  This is first found
  561.                               in Qmail DeLuxe² 1.25 version.  Most
  562.                               other QWK readers permit the use of
  563.                               mixed case subject lines but force the
  564.                               names to upper case only.
  565. FIDOTAG = YES                 If this line is found then the reader
  566.                               will automatically use FidoNet compliant
  567.                               tag-lines.
  568.  
  569. None of the lines are actually required and they may appear in any
  570. order.  Of course, you would need a CONTROLNAME if you have any
  571. CONTROLTYPE lines.
  572.  
  573. [4.3.2]  Qmail
  574.  
  575. Send a message addressed to "QMAIL" with a subject of "CONFIG".  Then,
  576. enter any of the commands listed below inside the text of your mes-
  577. sage.  Remember to use one command per line.
  578.  
  579. ADD <confnum>            Add a conference into the Qmail Door scanning
  580.                          list.  "YOURS" can also be added to the com-
  581.                          mand if the user wishes to receive messages
  582.                          only addressed them.  i.e. "ADD 1 YOURS"
  583. DROP <confnum>           Drop a conference from the Qmail Door scan-
  584.                          ning list.
  585. RESET <confnum> <value>  Resets a conference to a particular value.
  586.                          The user can use "HIGH-xxx" to set the confer-
  587.                          ence to the highest message in the base.
  588. CITY <value>             Changes the "city" field in the user's
  589.                          PCBoard entry.
  590. PASSWORD <value>         Changes the user's login password.
  591. BPHONE <value>           Business/data phone number
  592. HPHONE <value>           Home/voice phone number
  593. PCBEXPERT <on|off>       Turns the PCBoard expert mode ON or OFF.
  594. PCBPROT <value>          PCBoard file transfer protocol (A-Z).
  595. PAGELEN <value>          Set page length inside PCBoard.
  596. PCBCOMMENT <value>       Set user maintained comment.
  597. AUTOSTART <value>        Qmail Door autostart command.
  598. PROTOCOL <value>         Qmail Door file transfer protocol (A-Z).
  599. EXPERT <ON or OFF>       Turns the Qmail Door expert mode ON or OFF.
  600. MAXSIZE <value>          Maximum size of the user's .QWK packet (in
  601.                          bytes)
  602. MAXNUMBER <value>        Maximum number of messages per conference.
  603.  
  604. [4.3.3]  MarkMail
  605.  
  606. Send a message addressed to "MARKMAIL" with the subject line saying:
  607.  
  608. ADD [value]         in the conference you want to add
  609. DROP                in the conference you want to drop
  610. YOUR [value]        in the conference you want only your mail sent
  611. YA [value]          in the conference you want only your mail + mail
  612.                     addressed to "ALL"
  613. FILES ON or OFF     in any conference to tell MarkMail whether to scan
  614.                     for new files or not.
  615. BLTS ON or OFF      to turn on and off, respectively, of receiving
  616.                     bulletins.
  617. OWN ON or OFF       to turn on and off, respectively, of receiving
  618.                     messages you sent
  619. DELUXE ON or OFF    to turn on and off, respectively, of receiving
  620.                     DeLuxe menu
  621. LIMIT <size>        to set the maximum size of MESSAGES.DAT file can
  622.                     be, it cannot exceed what the Sysop has set up
  623.  
  624. An optional number can be added onto the commands "ADD", "YOUR", and
  625. "YA".  If this number is positive, then it will be treated as an abso-
  626. lute message number.  MarkMail will set your last read pointer to that
  627. number.  If it is negative, MarkMail will set your last read pointer
  628. to the highest minus that number.  For example: "ADD -50" will add the
  629. conference and set the last read pointer to the highest in the confer-
  630. ence minus 50.
  631.  
  632. [4.3.4]  KMail
  633.  
  634. Send a private message addressed to "KMAIL" in the conference that you
  635. want to add, drop, or reset.  The commands are "ADD", "DROP", and
  636. "RESET #", respectively.  The "#" is the message number you want your
  637. last read pointer in the conference be set to.
  638.  
  639. [4.3.5]  RoseMail
  640.  
  641. The RoseMail door allows configuration information be placed in either
  642. the subject line or message text.  The message must be addressed to
  643. "ROSEMAIL".  For only one command, it can be placed in the subject
  644. line.  For more than one changes, the subject line must say "CONFIG"
  645. and each change be placed in the message text.  Every line should be
  646. left justified.  Valid commands are:
  647.  
  648. Command                                           Example
  649. ───────────────────────────────────────────────── ──────────────────
  650. ADD <Conference> [<Message #>] [<Yours>]          ADD 2 -3 Y
  651. DROP <Conference>                                 DROP 2
  652. RESET <Conference> <Message #>                    RESET 12 5000
  653. PCBEXPERT <ON | OFF> - PCBoard expert mode        PCBEXPERT ON
  654. EXPERT <ON | OFF>    - RoseMail expert mode       EXPERT OFF
  655. PCBPROT <A - Z>      - PCBoard protocol           PCBPROT Z
  656. PROT <A - Z>         - RoseMail protocol          PROT G
  657. PAGELEN <Number>     - Page length                PAGELEN 20
  658. MAXSIZE <Kbytes>     - Max packet size in Kb      MAXSIZE 100
  659. MAXNUMBER <max msgs/conference>                   MAXNUMBER 100
  660. JUMPSTART <Sequence or OFF>                       JUMPSTART D;Y;Q
  661. MAXPACKET <max msgs/packet>                       MAXPACKET 500
  662. AUTOSTART <Sequence or OFF> - same as jumpstart   AUTOSTART OFF
  663. OPT <##> <ON | OFF>  - set door option            OPT 2 OFF
  664.  
  665. [4.3.6]  Complete Mail Door
  666.  
  667. Send message to "CMPMAIL", the commands are "ADD" and "DROP".  This
  668. message must be sent in the conference that you want to add or drop.
  669.  
  670. [4.4]  Turning off the echo flag
  671.  
  672. In order to send a non-echoed message (not send out to other BBSes), a
  673. user can enter "NE:" in front of the subject line.  The mail program
  674. will strip this "NE:" and turn off the echo flag.  This feature may
  675. not be offered in all mail doors.
  676.  
  677. [4.5]  Tag-lines
  678.  
  679. The most common format for a reader tag-line is:
  680.  
  681. ---
  682.  ■ My reader v1.00 ■ The rest of the tag-line.
  683.  
  684. The three dashes is called a tear-line.  The tag-line is appended to
  685. the end of the message and is usually one line only.  It is preferred
  686. that tag-lines conform to this format so that networking softwares
  687. such as QNet and RNet will not add another tearline to the message
  688. when they process it.
  689.  
  690. Softwares on FidoNet does not like mail readers adding a tear-line of
  691. their own, so if your mail reader offers a FidoNet mode, you will need
  692. to get rid of the tear-line.  Another item which differs between the
  693. FidoNet and PC-based networks is that FidoNet does not like extended
  694. ASCII characters.  So your reader may want to strip high ASCII if the
  695. user has FidoNet mode on.  Acceptable tag-line style, I believe, is
  696. just this:
  697.  
  698.  * My Reader v1.00 * The rest of the tag-line.
  699.  
  700. [5]  Net mail
  701.  
  702. I do not have complete information of net-mail implementation using
  703. QWK-format.  Someone please fill me in the details.
  704.  
  705.                      -=-=-=-=-=-=-<>-=-=-=-=-=-=-
  706.  
  707. [A]  Credits and Contributions
  708.  
  709. Mark "Sparky" Herring, who originated the QWK-format.
  710.  
  711. Tim Farley, who started this documentation back in the summer of 1990. 
  712. The general outline here is the work of Tim.  I filled in the blanks.
  713.  
  714. Jeffery Foy, who gave us the format for Microsoft single binary versus
  715. IEEE format.
  716.  
  717. Greg Hewgill, who (if I remember correctly) wrote the Turbo Pascal
  718. routines (included in here) to convert between MKS and TP LongInt.
  719.  
  720. Dennis McCunney, who is the host of the Off-line conference on RIME,
  721. is very knowledgeable in off-line reading concept and programs.  His
  722. goal is to have one reader that can read mail packet from any source.
  723.  
  724. All those who have been around the Off-line conferences on ILink (the
  725. oldest of the three I participate), RIME, and Intelec, who have provid-
  726. ed great help over the past two years.  The bulk of the information
  727. presented here are from messages in those conferences.  These people
  728. include, but are no limited to, the followings: Dane Beko, Joseph
  729. Carnage, Marcos Della, Joey Lizzi, Mark May, and Jim Smith.
  730.  
  731. [B]  Sample Turbo Pascal and C code
  732.  
  733. Here are a few routines in Turbo Pascal and C to convert Microsoft
  734. BASIC MKS format to usable IEEE long integer.  These are collected
  735. over the networks and there is no guarantee that they will work for
  736. you!
  737.  
  738. Turbo Pascal (Greg Hewgill ?):
  739.  
  740. type
  741.      bsingle = array [0..3] of byte;
  742.  
  743. { converts TP real to Microsoft 4 bytes single }
  744.  
  745. procedure real_to_msb (preal : real; var b : bsingle);
  746. var
  747.      r : array [0 .. 5] of byte absolute preal;
  748. begin
  749.      b [3] := r [0];
  750.      move (r [3], b [0], 3);
  751. end; { procedure real_to_msb }
  752.  
  753. { converts Microsoft 4 bytes single to TP real }
  754.  
  755. function msb_to_real (b : bsingle) : real;
  756. var
  757.      preal : real;
  758.      r : array [0..5] of byte absolute preal;
  759. begin
  760.      r [0] := b [3];
  761.      r [1] := 0;
  762.      r [2] := 0;
  763.      move (b [0], r [3], 3);
  764.      msb_to_real := preal;
  765. end; { procedure msb_to_real }
  766.  
  767. Another Turbo Pascal routine to convert Microsoft single to TP LongInt
  768. (Marcos Della):
  769.  
  770. index := ((mssingle and not $ff000000) or $00800000) shr (24 -
  771. ((mssingle shr 24) and $7f)) - 1;
  772.  
  773. C (identify yourself if you originated this routine):
  774.  
  775. /* converts 4 bytes Microsoft MKS format to long integer */
  776.  
  777. unsigned long mbf_to_int (m1, m2, m3, exp)
  778. unsigned int m1, m2, m3, exp;
  779. {
  780.      return (((m1 + ((unsigned long) m2 << 8) + ((unsigned long) m3 <<
  781.      16)) | 0x800000L) >> (24 - (exp - 0x80)));
  782. }
  783.  
  784. Microsoft binary (by Jeffery Foy):
  785.  
  786.    31 - 24    23     22 - 0        <-- bit position
  787. +-----------------+----------+
  788. | exponent | sign | mantissa |
  789. +----------+------+----------+
  790.  
  791. IEEE (C/Pascal/etc.):
  792.  
  793.    31     30 - 23    22 - 0        <-- bit position
  794. +----------------------------+
  795. | sign | exponent | mantissa |
  796. +------+----------+----------+
  797.  
  798. In both cases, the sign is one bit, the exponent is 8 bits, and the
  799. mantissa is 23 bits.  You can write your own, optimized, routine to
  800. convert between the two formats using the above bit layout.
  801.  
  802. [C]  Sample message
  803.  
  804. Here is a sample message in hex and ASCII format:
  805.  
  806. 019780  20 34 32 33 32 20 20 20 30 32 2D 31 35 2D 39 32   4232   02-15-92
  807. 019790  31 33 3A 34 35 52 49 43 48 41 52 44 20 42 4C 41  13:45RICHARD BLA
  808. 0197A0  43 4B 42 55 52 4E 20 20 20 20 20 20 20 20 53 54  CKBURN        ST
  809. 0197B0  45 56 45 20 43 4F 4C 45 54 54 49 20 20 20 20 20  EVE COLETTI     
  810. 0197C0  20 20 20 20 20 20 20 51 45 44 49 54 20 48 41 43         QEDIT HAC
  811. 0197D0  4B 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  K               
  812. 0197E0  20 20 20 20 20 20 20 20 20 20 20 20 34 30 33 36              4036
  813. 0197F0  20 20 20 20 37 20 20 20 20 20 E1 0A 01 00 00 20      7     ß
  814. 019800  2A 20 49 6E 20 61 20 6D 65 73 73 61 67 65 20 64  * In a message d
  815. 019810  61 74 65 64 20 30 32 2D 30 39 2D 39 32 20 74 6F  ated 02-09-92 to
  816. 019820  20 53 74 65 76 65 20 43 6F 6C 65 74 74 69 2C 20   Steve Coletti, 
  817. 019830  52 69 63 68 61 72 64 20 42 6C 61 63 6B 62 75 72  Richard Blackbur
  818. 019840  6E 20 73 61 69 64 3A E3 E3 52 42 3E 53 43 20 AF  n said:ππRB>SC »
  819. 019850  20 65 64 69 74 6F 72 20 69 6E 20 74 68 65 20 28   editor in the (
  820. 019860  6D 61 69 6E 66 72 61 6D 65 29 20 56 4D 2F 43 4D  mainframe) VM/CM
  821. 019870  53 20 70 72 6F 64 75 63 74 20 6C 69 6E 65 20 69  S product line i
  822. [ etc. ]
  823. 019A00  6E 6F 74 20 61 20 44 6F 63 74 6F 72 2C 20 62 75  not a Doctor, bu
  824. 019A10  74 20 49 20 70 6C 61 79 20 6F 6E 65 20 61 74 20  t I play one at 
  825. 019A20  74 68 65 20 48 6F 73 70 69 74 61 6C 2E E3 20 20  the Hospital.π  
  826. 019A30  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
  827. 019A40  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
  828. 019A50  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
  829. 019A60  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
  830. 019A70  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
  831. 019A80  E3 50 43 52 65 6C 61 79 3A 4D 4F 4F 4E 44 4F 47  πPCRelay:MOONDOG
  832. 019A90  20 2D 3E 20 23 33 35 20 52 65 6C 61 79 4E 65 74   -> #35 RelayNet
  833. 019AA0  20 28 74 6D 29 E3 34 2E 31 30 20 20 20 20 20 20   (tm)π4.10      
  834. 019AB0  20 20 20 20 20 20 20 20 20 48 55 42 4D 4F 4F 4E           HUBMOON
  835. 019AC0  2D 4D 6F 6F 6E 44 6F 67 20 42 42 53 2C 20 42 72  -MoonDog BBS, Br
  836. 019AD0  6F 6F 6B 6C 79 6E 2C 4E 59 20 37 31 38 20 36 39  ooklyn,NY 718 69
  837. 019AE0  32 2D 32 34 39 38 E3 20 20 20 20 20 20 20 20 20  2-2498π         
  838. 019AF0  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
  839.  
  840. [D]  Sample index file
  841.  
  842. Here is a sample index file in hex format:
  843.  
  844. 000000  00 00 28 87 19 00 00 30 87 19 00 00 38 87 19 00
  845. 000010  00 7E 87 19 00 00 07 88 19 00 00 0B 88 19 00 00
  846. 000020  0F 88 19 00 00 14 88 19 00 00 19 88 19 00 00 1E
  847. 000030  88 19 00 00 22 88 19 00 00 27 88 19 00 00 2C 88
  848. 000040  19 00 00 31 88 19 00 00 3B 88 19 00 00 40 88 19
  849. 000050  00 00 46 88 19 00 00 49 88 19 00 00 4D 88 19 00
  850. 000060  00 52 88 19 00 00 55 88 19 00 00 59 88 19 00 00
  851. 000070  60 88 19 00 00 66 88 19 00 00 70 88 19
  852.